XSI-1706/CP-51295: limit open TCP connections to 250 and increase soc… #5953
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…ket backlog
The default limit of 800 external TCP connections still leads to EMFILE for authenticated users.
Due to the use of Unix.select/Thread.wait_timed_read we cannot increase the file descriptor limit beyond 1024 currently.
We can assume that each API call needs at least 4 file descriptors:
An API call could of course need more file descriptors than these, the real solution is to move to poll(2)/epoll(2) which doesn't have the 1024 limit that select(2) does.
However meanwhile this prevents problems that users have reported.
The downside is that users may now get client-side TCP errors if they open too many connections, but that is better than causing errors on unrelated API calls. To compensate increase the socket backlog from the default 128.
Due to the old kernel that Dom0 runs this will also require changing 'somaxconn' in /etc/sysctl.d/90-dom0.conf, but this is not controlled by XAPI.